﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ComponentFactory.Krypton.Toolkit;
namespace SpaceChimpIDE
{
    public partial class SvnUrlGetter : KryptonForm
    {
        public string Picked { get; set; }
        public bool Done { get; set; }
        public bool Checkout = false;
        public bool Commit = false;
        public Form1 Owner { get; set; }
        public SvnUrlGetter ( )
        {
            InitializeComponent ( );
            Picked = "NotSet";
            Owner = null;
            Done = false;
        }

        private void kryptonContextMenu1_Opening ( object sender, CancelEventArgs e )
        {

        }

        private void pasteToolStripMenuItem_Click ( object sender, EventArgs e )
        {
            //URL.Paste();

            CommitLog.Paste();
        }

        private void kryptonButton1_Click ( object sender, EventArgs e )
        {
            Picked = URL.Text;
            //Done = true;
            //Close();
            if(Picked=="") Picked = "NotSet";
            Done = true;
            Form1.Svn.SvnUrl = Picked;
            Form1.Svn.LogMsg = CommitLog.Text;
            Close();
            if ( Picked != "NotSet" )
            {
                if (Checkout) Owner.CheckoutProject();
                if(Commit) Owner.CommitProject();
            }
        }
    }
}
